# -*- coding:utf-8 -*-
__author__ = 'weikai'
import sys

reload(sys)
sys.setdefaultencoding('utf8')
global null, false, true
null = None
false = False
true = True
premiumTemp = {
    "vehicleJingyou": {
        "kindredPrice": "103800",
        "displacement": "1.598",
        "seat": "5",
        "rate": "",
        "factoryName": "东风汽车有限公司",
        "tonnage": "0",
        "hfcode": "0",
        "taxPrice": "116838",
        "groupRepairRate": "",
        "kindredPriceTax": "110454",
        "vehicleType": "1",
        "bdRiskFlag2": "",
        "fullWeight": "1165",
        "antiTheft": "",
        "bdRiskFlag3": "",
        "carKindCode": "KA",
        "hfname": "正常",
        "newVehicleClassCode": "JC03",
        "pricetype": "",
        "bdRiskFlag4": "",
        "bodyType": "两厢",
        "bdRiskFlag1": "",
        "power": "80",
        "riskFlags": "",
        "vehicleAlias": "骐达1.6L AT时尚型",
        "price": "109800",
        "familyName": "骐达",
        "brandCode": "RCA1",
        "carType": "",
        "flag": "",
        "fitsRiskRate": "",
        "vehicleCode": "RCABLD0005",
        "marketDate": "2005",
        "remark": "自动档 G 时尚型",
        "stopFlag": "1",
        "newVehicleClass": "紧凑型轿车(A)",
        "factoryCode": "MK01063",
        "familyCode": "RCA1BL",
        "groupFitsRate": "",
        "vehicleClassCode": "轿车类",
        "brandName": "东风日产",
        "searchCode": "QD-DFL7161AA",
        "vehicleClassName": "骐达DFL7161AA轿车",
        "vehicleName": "骐达DFL7161AA轿车",
        "gearboxType": "自动档",
        "gearboxTypeCode": "BS02",
        "airbagNum": "2"
    },
    "kinds": [
        {
            "amount": "122000.00",
            "kindName": "机动车交通事故责任强制保险",
            "flag": "10",
            "kindCode": "BZ"
        },
        {
            "amount": "21590.00",
            "kindName": "机动车损失险",
            "flag": "11",
            "kindCode": "A",
            "deductible": "0"
        },
        {
            "amount": 0,
            "kindName": "机动车损失险不计免赔",
            "flag": "20",
            "kindCode": "MA"
        },
        {
            "amount": "50000.00",
            "kindName": "第三者责任险",
            "flag": "11",
            "kindCode": "B"
        },
        {
            "amount": 0,
            "kindName": "第三者责任险不计免赔",
            "flag": "20",
            "kindCode": "MB"
        },
        {
            "amount": "21590.00",
            "kindName": "全车盗抢险",
            "flag": "11",
            "kindCode": "G"
        },
        {
            "amount": 0,
            "kindName": "机动车盗抢险不计免赔",
            "flag": "20",
            "kindCode": "MG"
        },
        {
            "amount": "10000.00",
            "kindName": "车上人员责任险：驾驶员",
            "flag": "11",
            "kindCode": "D3"
        },
        {
            "amount": 0,
            "kindName": "车上人员(驾驶员)责任不计免赔",
            "flag": "20",
            "kindCode": "MD3"
        },
        {
            "unitAmount": "10000.00",
            "amount": 40000,
            "flag": "11",
            "kindName": "车上人员责任险：乘客",
            "kindCode": "D4",
            "quantity": "4"
        },
        {
            "amount": 0,
            "kindName": "车上人员(乘客)责任不计免赔",
            "flag": "20",
            "kindCode": "MD4"
        },
        {
            "modeName": "国产玻璃",
            "modeCode": "1",
            "flag": "20",
            "amount": "103800.00",
            "kindName": "玻璃单独破碎险",
            "kindCode": "F"
        },
        {
            "amount": "2000.00",
            "kindName": "车身划痕损失险",
            "flag": "21",
            "kindCode": "L"
        },
        {
            "amount": 0,
            "kindName": "车身划痕损失险不计免赔",
            "flag": "20",
            "kindCode": "ML"
        },
        {
            "amount": "21590.00",
            "kindName": "自燃损失险",
            "flag": "20",
            "kindCode": "Z"
        },
        {
            "amount": 0,
            "kindName": "发动机涉水损失险",
            "flag": "21",
            "kindCode": "X1"
        },
        {
            "amount": 0,
            "kindName": "发动机涉水损失险不计免赔",
            "flag": "20",
            "kindCode": "MX1"
        }
    ],
    "devices": [],
    "agentComm": {
        "costStandardRateBZ": "",
        "vocationalNo": "",
        "agencyID": "",
        "agencyCode": "",
        "businessNature": "0",
        "costName": "手续费",
        "areaFlagName": "320100-南京市",
        "countyCode": "320114",
        "ptCode": "",
        "countyName": "320114-雨花台区",
        "costCode": "",
        "costStandardRateCIP": "",
        "costActualRateBZ": "",
        "costActualRateCIP": "",
        "certificateNo": "",
        "salePeople": "饶政婷",
        "areaFlag": "320100",
        "salesmanCode": "32065054"
    },
    "car": {
        "licenseType": "02",
        "colorCode": "06",
        "netWeight": "1165.000",
        "carKindCodeNew": "K1",
        "modelAlias": "骐达1.6L AT时尚型",
        "chgOwnerFlag": "0",
        "carChecker": "",
        "abnormalCarFlag": "0",
        "lastYearDamage": "",
        "carLicenceDate": "",
        "enrollDate": "2006-04-05",
        "seatCountOld": "5",
        "carCheckerReason": "000",
        "useNatureCode": "85",
        "certificateType": "",
        "fuelType": "0",
        "licenseNo": "苏GK5126",
        "modelName": "骐达DFL7161AA",
        "exhaustScale": "1.598",
        "transferDate": "",
        "specialCarFlag": "",
        "useNatureCodeNew": "N85",
        "carKindCode": "KA",
        "useYears": "11",
        "industryModelCode": "BDFJQEUB0003",
        "exhaustScaleOld": "1.598",
        "haulage": "0",
        "modelCodePlat": "RCABLD0005",
        "engineNo": "114842A",
        "deviceActualValueCount": null,
        "deviceQuantityCount": null,
        "tradeName": "东风汽车有限公司",
        "certificateNo": "",
        "ecdemicVehicleFlag": "0",
        "brand": "东风日产",
        "runAreaName": "中华人民共和国境内(不含港澳台)",
        "powerScale": "",
        "modelNamePlat": "骐达DFL7161AA",
        "fixedLine": "",
        "vinNo": "LGBG22E056Y027789",
        "purchasePriceType": "02",
        "noticeType": "DFL7161AA",
        "carKindCatalogCode": "K",
        "countryNature": "1",
        "sortCode": "",
        "noDamageYears": "0",
        "certificateDate": "",
        "carRegiste": "0",
        "runAreaCode": "11",
        "seatCount": "5",
        "purchasePriceOld": "103800.00",
        "netWeightOld": "1165.000",
        "isPrintModelAlias": "0",
        "carName": "骐达DFL7161AA AT 时尚型",
        "tonCount": "0.0000",
        "vehicleDamaged": "1",
        "bookingTime": "",
        "devicePurchasePriceCount": null,
        "runMiles": "45000",
        "loanVehicleFlag": "0",
        "noLicenseFlag": "0",
        "actualValueOld": 21590.399999999998,
        "expecLossRatio": "",
        "isNewCarFlag": "0",
        "purchasePrice": "103800.00",
        "licenseColorCode": "01",
        "actualValue": "21590",
        "depreciation": "0.60",
        "tonCountOld": "0.0000",
        "carCheckTime": "",
        "vehicleStyle": "K33",
        "deptName": "合资",
        "modelCode": "RCABLD0005",
        "carCheckStatus": "1"
    },
    "drivers": [],
    "tax": {
        "endTaxDate": "2017-12-31",
        "lastTaxDate": "2016-01-01",
        "taxPayerType": "2",
        "lastEndTaxDate": "",
        "taxPayer": "320723196809015624",
        "lastTimeBZEndDate": "",
        "taxPayerAddress": "江苏南京",
        "startTaxDate": "",
        "carType": "A",
        "taxPayerIdentifyType": "01",
        "taxPayerIdentifyNumber": "320723196809015624",
        "taxFlag": "T",
        "taxPayerName": "张秀林",
        "net": "1165.00",
        "oriTaxFlag": "T"
    },
    "comments": [],
    "persons": [
        {
            "isInsured": true,
            "insuredName": "张秀林",
            "isCarOwner": true,
            "isDriver": false,
            "taxPayerNum": "",
            "insuredNature": "1",
            "isPost": false,
            "insuredFlag": "111000",
            "insuredAddress": "江苏南京",
            "isApply": true,
            "phoneNumber": "",
            "carRelation": "1",
            "identifyType": "01",
            "occupationCode": "",
            "email": "",
            "taxPayerType": "",
            "unitType": "",
            "invoiceType": "",
            "occupationName": "",
            "bank": "",
            "account": "",
            "isBenefit": false,
            "mobile": "15251837618",
            "identifyNumber": "320723196809015624",
            "insuredType": "3",
            "postCode": ""
        }
    ],
    "base": {
        "startDate": "2017-04-11",
        "businessSort": "0",
        "endDate": "2018-04-10",
        "argueSolution": "1",
        "arbitBoardName": "",
        "shareHolderFlag": "0",
        "packageCode": "",
        "isAboutArgi": "0",
        "startDateCI": "2017-04-11",
        "policySort": "2",
        "compulsoryCheckQuestion": "",
        "calcPremiumFlag": "0",
        "commercialCheckQuestion": "",
        "operateDate": "2017-04-10",
        "endMinuteCI": "0",
        "operatorName": "陈修龙",
        "endHourCI": "24",
        "startMinuteCI": "0",
        "preProposalTopNo": "TI00000000000003077744",
        "comName": "华农保险江苏省分公司营业部",
        "getCarFlag": "0",
        "expectDiscount": "",
        "handler": "饶政婷",
        "makeCom": "32060000",
        "compulsoryInstant": "0",
        "handlerCode": "32065054",
        "commercialCheckAnswer": "",
        "clauseType": "01",
        "forceUndwrtFlag": "0",
        "startHourCI": "0",
        "endHour": "24",
        "handlerPhone": "13000000000",
        "handlerJiangsu": "陈修龙",
        "endMinute": "0",
        "operateSite": "南京市鼓楼区中山路99号708室",
        "startMinute": "0",
        "flag": "000",
        "countyCode": "320114",
        "endDateCI": "2018-04-10",
        "startHour": "0",
        "additionalCostRate": 0.35,
        "areaFlag": "320100",
        "compulsoryCheckAnswer": "",
        "comId": "32065200",
        "isIllegalMoney": "0",
        "comCode": "32065200",
        "appointAreaCode": "",
        "commercialInstant": "0",
        "operatorCode": "32060168"
    },
    "directComms": [],
    "linkComms": [],
    "engages": [],
    "profitBZ": {},
    "profits": []
}

insuranceType = {
    'compulsoryInsurance': "1",  # 交通事故强制责任险
    'nAggTax': '1',  # 车船税
    'otherHurtPremium': {"isCheck": "1", "Amount": "500000"},  # 第三者责任保险
    'carNickPremium': {"isCheck": "1", "Amount": "2000"},  # 车身划痕损失险
    'driverDutyPremium': {"isCheck": "1", "Amount": "10000"},  # 车上人员责任保险（司机）
    'passengerDutyPremium': {"isCheck": "1", "Amount": "10000"},  # 车上人员责任保险（乘客）

    'glassBrokenPremium': "1",  # 玻璃单独破碎险(国产)
    'carFirePremium': "1",  # 自燃损失险
    'engineWadingPremium': "1",  # 发动机涉水损失险
    'carTheftPremium': "1",  # 全车盗抢保险
    'carDamagePremium': "1",  # 车辆损失保险
    'carDamageBenchMarkPremium': '1',  # 不计免赔——车辆损失保险
    'otherHurtBenchMarkPremium': '1',  # 不计免赔——第三者责任保险
    'carTheftBenchMarkPremium': '1',  # 不计免赔——全车盗抢保险
    'driverDutyBenchMarkPremium': '1',  # 不计免赔——车上人员责任保险（司机）
    'passengerBenchMarkPremium': '1',  # 不计免赔——车上人员责任保险（乘客）
    'carNickBenchMarkPremium': '1',  # 不计免赔——车身划痕损失险
    'carFireBrokenBenchMarkPremium': '1',  # 不计免赔——自燃损失险
    'engineWadingBenchMarkPremium': '1'  # 不计免赔——发动机涉水损失险
}


carModelbody={
  "licenseType": "02",
  "colorCode": "03",
  "netWeight": "1480.000",
  "carKindCodeNew": "K1",
  "modelAlias": "起亚K5 2.0L AT GL",
  "chgOwnerFlag": "0",
  "carChecker": "",
  "abnormalCarFlag": "0",
  "lastYearDamage": "",
  "carLicenceDate": "",
  "enrollDate": "2014-11-21",
  "seatCountOld": "5",
  "carCheckerReason": "000",
  "useNatureCode": "85",
  "certificateType": "",
  "fuelType": "0",
  "licenseNo": "苏J98Z32",
  "modelName": "起亚YQZ7204AE5",
  "exhaustScale": "1.999",
  "transferDate": "",
  "specialCarFlag": "",
  "useNatureCodeNew": "N85",
  "carKindCode": "KA",
  "useYears": "2",
  "industryModelCode": "BYDLYKUB0002",
  "exhaustScaleOld": "1.999",
  "haulage": "0",
  "modelCodePlat": "QYAADD0067",
  "engineNo": "EW589551",
  "tradeName": "东风悦达起亚汽车有限公司",
  "certificateNo": "",
  "ecdemicVehicleFlag": "0",
  "brand": "东风悦达起亚",
  "runAreaName": "中华人民共和国境内(不含港澳台)",
  "powerScale": "",
  "modelNamePlat": "起亚YQZ7204AE5",
  "fixedLine": "",
  "vinNo": "LJDKAA241E0191588",
  "purchasePriceType": "01",
  "noticeType": "",
  "carKindCatalogCode": "K",
  "countryNature": "1",
  "sortCode": "",
  "noDamageYears": "0",
  "certificateDate": "",
  "carRegiste": "0",
  "runAreaCode": "11",
  "seatCount": "5",
  "purchasePriceOld": "132800.00",
  "netWeightOld": "1480.000",
  "isPrintModelAlias": "0",
  "carName": "",
  "tonCount": "0.0000",
  "vehicleDamaged": "1",
  "bookingTime": "",
  "runMiles": "45000",
  "loanVehicleFlag": "0",
  "noLicenseFlag": "0",
  "actualValueOld": 110489.59999999999,
  "expecLossRatio": "",
  "isNewCarFlag": "0",
  "purchasePrice": "132800.00",
  "licenseColorCode": "01",
  "actualValue": "110490",
  "depreciation": "0.60",
  "tonCountOld": "0.0000",
  "carCheckTime": "",
  "vehicleStyle": "K33",
  "deptName": "远舰/K5",
  "modelCode": "QYAADD0067",
  "carCheckStatus": "1"
}